Skip to content

fix: don't treat closing quote as escaped after an escaped backslash#262

Merged
joho merged 1 commit into
joho:mainfrom
SAY-5:fix/escaped-backslash-quote
May 19, 2026
Merged

fix: don't treat closing quote as escaped after an escaped backslash#262
joho merged 1 commit into
joho:mainfrom
SAY-5:fix/escaped-backslash-quote

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 13, 2026

When scanning for a quoted value's terminator, a closing quote was skipped whenever the preceding byte was a backslash, even if that backslash was itself escaped, so FOO="bar\\" failed with "unterminated quoted value". The quote is now considered escaped only when preceded by an odd number of backslashes, matching the behaviour of the reference dotenv parsers. Closes #225

@joho joho merged commit 529bc60 into joho:main May 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extractVarValue assumes a quote is escaped if a backslash precedes it, even if the backslash is escaped

2 participants